.PHONY: all build clean lint help

all: fmt lint clean run

fmt:
    @echo ">> format source"
    @gofmt -w .

lint:
    @golint ./...

clean:
    @echo "Cleaning build cache"
    @go clean -i

api:
    @echo "generate doc api"
    @apidoc -i handle/ -o doc/

run:
    @echo ">> go build"
    @go run server.go

build:
    @echo ">> go build"
    @go build -v .

install:
    @go install

vendor: glide.lock glide.yaml
    @echo "下载 golang 依赖"
    @glide install

fmt:
    @echo ">> format source"
    @gofmt -w .

test: vendor api json
    @echo "运行单元测试"
    @go test

help:
    @echo "make: compile packages and dependencies"
    @echo "make fmt: run specified go tool"
    @echo "make lint: golint ./..."
    @echo "make clean: remove object files and cached files"





